-- GENERATED SPELL FOR [Zanzil the Outcast] --


function spell0_2534(pUnit, Event) --@Lava Spout Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(8264,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_2534', 1, 1)
end

function spell1_2534(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(9532,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2534', 3000, 1)
end

function spell2_2534(pUnit, Event) --@Ward of Zanzil,Self--
pUnit:FullCastSpellOnTarget(8832,pUnit)
pUnit:RegisterEvent('Sorts_2534', 20000, 1)
end

function Sorts_2534(pUnit, Event)
local choix_sorts_2534 = math.random(0, 2)
if choix_sorts_2534 == 0 then
pUnit:RegisterEvent('spell0_2534', 1, 1)
end
if choix_sorts_2534 == 1 then
pUnit:RegisterEvent('spell1_2534', 1, 1)
end
if choix_sorts_2534 == 2 then
pUnit:RegisterEvent('spell2_2534', 1, 1)
end
end

function mob2534_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2534', math.random(1500, 3000), 1)
end

function mob2534_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2534_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2534_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2534, 1, 'mob2534_Action')
RegisterUnitEvent(2534, 2, 'mob2534_Leave')
RegisterUnitEvent(2534, 3, 'mob2534_Kill')
RegisterUnitEvent(2534, 4, 'mob2534_Die')
